<template>
	<view>
		<uv-gap height="20"></uv-gap>
		<view class="defultBackground">
			<view class="borderbottom">
				<lableInput v-model="accountInfo.phone" label="商户手机号" placeholder="请输入申请人手机号"></lableInput>
			</view>
			<view class="borderbottom">
				<codeInput v-model="accountInfo.code" />
			</view>
			<view class="borderbottom">
				<lableInput v-model="accountInfo.account" label="登录账号" placeholder="请输入登录账号"></lableInput>
			</view>
			<view class="titleH3 pall20"> 注:商户初始密码为注册手机号后6位 </view>
		</view>
		<fui-checkbox-group name="checkbox" @change="change">
			<view class="rowStart pall20 gap10 defultBackground alignStart">
				<fui-checkbox value="1" color="#fd5f47"></fui-checkbox>
				<text class="fui-text">同意</text>
				<view class="cloummStart gap10 alignStart">
					<agreeTag :tips="item.tag" :url="item.url" v-for="(item, index) in infoList" :key="index">
					</agreeTag>
				</view>
			</view>
		</fui-checkbox-group>

	</view>
</template>

<script>
	import agreeTag from "@/components/agreeTag/agreeTag.vue";
	export default {
		components: {
			agreeTag
		},
		data() {
			return {
				accountInfo: {
					phone: '',
					code: '',
					account: '',
				},
				agreen: false,
				infoList: [{
						tag: "付呗商户注册及服务协议",
						url: "https://doc.firstui.cn/docs/form/input.html",
					},
					{
						tag: "付呗绑卡协议",
						url: "https://doc.firstui.cn/docs/form/input.html",
					},
					{
						tag: "乐刷科技有限公司移动支付收单业务特约商户协议",
						url: "https://doc.firstui.cn/docs/form/input.html",
					},
				],
			};
		},
		methods: {
			//校验输入框是不是都填了
			checkForm() {
				if (!this.agreen) {
					return uni.$uv.toast('请先同意协议')
				}
				if (this.accountInfo.phone && this.accountInfo.code && this.accountInfo.account) {
					return this.accountInfo;
				} else {
					return false;
				}
			},
			change(e) {
				this.agreen = e.detail.value.includes('1');
			}

		}
	};
</script>

<style>
</style>